home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / MoreFiles 1.2.1 / MoreFiles.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-17  |  26.6 KB  |  823 lines  |  [TEXT/KAHL]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    The long lost high-level and FSSpec File Manager functions.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        MoreFiles.h
  9. **
  10. **    Copyright © 1992-1994 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILES__
  23. #define __MOREFILES__
  24.  
  25.  
  26. #ifndef __TYPES__
  27. #include <Types.h>
  28. #endif
  29.  
  30. #ifndef __ERRORS__
  31. #include <Errors.h>
  32. #endif
  33.  
  34. #ifndef __MEMORY__
  35. #include <Memory.h>
  36. #endif
  37.  
  38. #ifndef __OSUTILS__
  39. #include <OSUtils.h>
  40. #endif
  41.  
  42. #ifndef __FILES__
  43. #include <Files.h>
  44. #endif
  45.  
  46. /*    Sharing.h should be in Files.h, but isn't yet... */
  47. //#ifndef __SHARING__
  48. //#include "Sharing.h"
  49. //#endif
  50.  
  51.  
  52. /*****************************************************************************/
  53.  
  54. pascal    OSErr    HGetVolParms(StringPtr volName,
  55.                              short vRefNum,
  56.                              GetVolParmsInfoBuffer *volParmsInfo,
  57.                              long *infoSize);
  58. /*    ¶ Determine the characteristics of a volume.
  59.     The HGetVolParms function returns information about the characteristics
  60.     of a volume. A result of paramErr usually just means the volume doesn't
  61.     support PBHGetVolParms and the feature you were going to check
  62.     for isn't available.
  63.  
  64.     volName            input:    A pointer to the name of a mounted volume
  65.                             or nil.
  66.     vRefNum            input:    Volume specification.
  67.     volParmsInfo    input:    Pointer to GetVolParmsInfoBuffer where the
  68.                             volume attributes information is returned.
  69.                     output:    Atributes information.
  70.     infoSize        input:    Size of buffer pointed to by volParmsInfo.
  71.                     output: Size of data actually returned.
  72.  
  73.     __________
  74.     
  75.     Also see the macros for checking attribute bits in MoreFilesExtras.h
  76. */
  77.  
  78. /*****************************************************************************/
  79.  
  80. pascal    OSErr    HCreateMinimum(short vRefNum,
  81.                                long dirID,
  82.                                ConstStr255Param fileName);
  83. /*    ¶ Create a new file with no creator or file type.
  84.     The HCreateMinimum function creates a new file without attempting to set
  85.     the creator and file type of the new file.  This function is needed to
  86.     create a file in an AppleShare "drop box" where the user can make
  87.     changes, but cannot see folder or files.
  88.     
  89.     vRefNum        input:    Volume specification.
  90.     dirID        input:    Directory ID.
  91.     fileName    input:    The name of the new file.
  92.  
  93.     __________
  94.     
  95.     Also see:    FSpCreateMinimum
  96. */
  97.  
  98. /*****************************************************************************/
  99.  
  100. pascal    OSErr    FSpCreateMinimum(const FSSpec *spec);
  101. /*    ¶ Create a new file with no creator or file type.
  102.     The FSpCreateMinimum function creates a new file without attempting to set 
  103.     the the creator and file type of the new file.  This function is needed to
  104.     create a file in an AppleShare "dropbox" where the user can make
  105.     changes, but cannot see folder or files. 
  106.     
  107.     spec        input:    An FSSpec record specifying the file to create.
  108.  
  109.     __________
  110.     
  111.     Also see:    HCreateMinimum
  112. */
  113.  
  114. /*****************************************************************************/
  115.  
  116. pascal    OSErr    ExchangeFiles(short vRefNum,
  117.                               long srcDirID,
  118.                               ConstStr255Param srcName,
  119.                               long dstDirID,
  120.                               ConstStr255Param dstName);
  121. /*    ¶ Exchange the data stored in two files on the same volume.
  122.     The ExchangeFiles function swaps the data in two files on the same
  123.     volume by changing some of the information in the volume catalog and,
  124.     if the files are open, in the file control blocks.
  125.  
  126.     vRefNum        input:    Volume specification.
  127.     srcDirID    input:    Source directory ID.
  128.     srcName        input:    Source file name.
  129.     dstDirID    input:    Destination directory ID.
  130.     dstName        input:    Destination file name.
  131.  
  132.     __________
  133.     
  134.     Also see:    FSpExchangeFilesCompat
  135. */
  136.  
  137. /*****************************************************************************/
  138.  
  139. pascal    OSErr    ResolveFileIDRef(StringPtr volName,
  140.                                  short vRefNum,
  141.                                  long fileID,
  142.                                  long *parID,
  143.                                  StringPtr fileName);
  144. /*    ¶ Retrieve the location of the file with the specified file ID.
  145.     The ResolveFileIDRef function returns the filename and parent directory ID
  146.     of the file with the specified file ID.
  147.     
  148.     volName    input:    A pointer to the name of a mounted volume
  149.                     or nil.
  150.     fileID    input:    The file ID.
  151.     vRefNum    input:    Volume specification.
  152.     parID    output:    The parent directory ID of the file.
  153.     name    input:    Points to a buffer (minimum Str63) where the filename
  154.                     is to be returned or must be nil.
  155.             output:    The filename.
  156.  
  157.     __________
  158.     
  159.     Also see:    CreateFileIDRef, FSpCreateFileIDRef, DeleteFileIDRef
  160. */
  161.  
  162. /*****************************************************************************/
  163.  
  164. pascal    OSErr    CreateFileIDRef(short vRefNum,
  165.                                 long parID,
  166.                                 ConstStr255Param fileName,
  167.                                 long *fileID);
  168. /*    ¶ Establish a file ID for a file.
  169.     The CreateFileIDRef function creates a file ID for the specified file,
  170.     or if a file ID already exists, supplies the file ID and returns the
  171.     result code fidExists
  172.  
  173.     vRefNum        input:    Volume specification.
  174.     parID        input:    Directory ID.
  175.     fileName    input:    The name of the file.
  176.     fileID        output:    The file ID.
  177.  
  178.     __________
  179.     
  180.     Also see:    ResolveFileIDRef, FSpCreateFileIDRef, DeleteFileIDRef
  181. */
  182.  
  183. /*****************************************************************************/
  184.  
  185. pascal    OSErr    FSpCreateFileIDRef(const FSSpec *spec,
  186.                                    long *fileID);
  187. /*    ¶ Establish a file ID for a file.
  188.     The FSpCreateFileIDRef function creates a file ID for the specified file,
  189.     or if a file ID already exists, supplies the file ID and returns the
  190.     result code fidExists
  191.  
  192.     spec        input:    An FSSpec record specifying the file.
  193.     fileID        output:    The file ID.
  194.  
  195.     __________
  196.     
  197.     Also see:    ResolveFileIDRef, CreateFileIDRef, DeleteFileIDRef
  198. */
  199.  
  200. /*****************************************************************************/
  201.  
  202. pascal    OSErr    DeleteFileIDRef(StringPtr volName,
  203.                                 short vRefNum,
  204.                                 long fileID);
  205. /*    ¶ Delete a file ID reference.
  206.     The DeleteFileIDRef function deletes a file ID reference.
  207.  
  208.     volName    input:    A pointer to the name of a mounted volume
  209.                     or nil.
  210.     vRefNum    input:    Volume specification.
  211.     fileID    input:    The file ID.
  212.  
  213.     __________
  214.     
  215.     Also see:    ResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef
  216. */
  217.  
  218. /*****************************************************************************/
  219.  
  220. pascal    OSErr    FlushFile(short refNum);
  221. /*    ¶ Write the contents of a file's access path buffer (the fork data).
  222.     The FlushFile function writes the contents of a file's access path
  223.     buffer (the fork data) to the volume. Note: some of the file's catalog
  224.     information stored on the volume may not be correct until FlushVol
  225.     is called.
  226.  
  227.     refNum    input:    The file reference number of an open file.
  228. */
  229.  
  230. /*****************************************************************************/
  231.  
  232. pascal    OSErr    LockRange(short refNum,
  233.                           long rangeLength,
  234.                           long rangeStart);
  235. /*    ¶ Lock a portion of a file.
  236.     The LockRange function locks (denies access to) a portion of a file
  237.     that was opened with shared read/write permission.
  238.  
  239.     refNum        input:    The file reference number of an open file.
  240.     rangeLength    input:    The number of bytes in the range.
  241.     rangeStart    input:    The starting byte in the range to lock.
  242.  
  243.     __________
  244.     
  245.     Also see:    UnlockRange
  246. */
  247.  
  248. /*****************************************************************************/
  249.  
  250. pascal    OSErr    UnlockRange(short refNum,
  251.                             long rangeLength,
  252.                             long rangeStart);
  253. /*    ¶ Unlock a previously locked range.
  254.     The UnlockRange function unlocks (allows access to) a previously locked
  255.     portion of a file that was opened with shared read/write permission.
  256.  
  257.     refNum        input:    The file reference number of an open file.
  258.     rangeLength    input:    The number of bytes in the range.
  259.     rangeStart    input:    The starting byte in the range to unlock.
  260.  
  261.     __________
  262.     
  263.     Also see:    LockRange
  264. */
  265.  
  266. /*****************************************************************************/
  267.  
  268. pascal    OSErr    GetForeignPrivs(short vRefNum,
  269.                                 long dirID,
  270.                                 StringPtr name,
  271.                                 Ptr foreignPrivBuffer,
  272.                                 long *foreignPrivSize,
  273.                                 long *foreignPrivInfo1,
  274.                                 long *foreignPrivInfo2,
  275.                                 long *foreignPrivInfo3,
  276.                                 long *foreignPrivInfo4);
  277. /*    ¶ Retrieve the native access-control information.
  278.     The GetForeignPrivs function retrieves the native access-control
  279.     information for a file or directory stored on a volume managed by
  280.     a foreign file system.
  281.     
  282.     vRefNum                input:    Volume specification.
  283.     dirID                input:    Directory ID.
  284.     name                input:    Pointer to object name, or nil when dirID
  285.                                 specifies a directory that's the object.
  286.     foreignPrivBuffer    input:    Pointer to buffer where the privilege
  287.                                 information is returned.
  288.                         output:    Privilege information.
  289.     foreignPrivSize        input:    Size of buffer pointed to by
  290.                                 foreignPrivBuffer.
  291.                         output: Amount of buffer actually used.
  292.     foreignPrivInfo1    output:    Information specific to privilege model.
  293.     foreignPrivInfo2    output:    Information specific to privilege model.
  294.     foreignPrivInfo3    output:    Information specific to privilege model.
  295.     foreignPrivInfo4    output:    Information specific to privilege model.
  296.  
  297.     __________
  298.     
  299.     Also see:    FSpGetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
  300. */
  301.  
  302. /*****************************************************************************/
  303.  
  304. pascal    OSErr    FSpGetForeignPrivs(const FSSpec *spec,
  305.                                    Ptr foreignPrivBuffer,
  306.                                    long *foreignPrivSize,
  307.                                    long *foreignPrivInfo1,
  308.                                    long *foreignPrivInfo2,
  309.                                    long *foreignPrivInfo3,
  310.                                    long *foreignPrivInfo4);
  311. /*    ¶ Retrieve the native access-control information.
  312.     The FSpGetForeignPrivs function retrieves the native access-control
  313.     information for a file or directory stored on a volume managed by
  314.     a foreign file system.
  315.     
  316.     spec                input:    An FSSpec record specifying the object.
  317.     foreignPrivBuffer    input:    Pointer to buffer where the privilege
  318.                                 information is returned.
  319.                         output:    Privilege information.
  320.     foreignPrivSize        input:    Size of buffer pointed to by
  321.                                 foreignPrivBuffer.
  322.                         output: Amount of buffer actually used.
  323.     foreignPrivInfo1    output:    Information specific to privilege model.
  324.     foreignPrivInfo2    output:    Information specific to privilege model.
  325.     foreignPrivInfo3    output:    Information specific to privilege model.
  326.     foreignPrivInfo4    output:    Information specific to privilege model.
  327.  
  328.     __________
  329.     
  330.     Also see:    GetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
  331. */
  332.  
  333. /*****************************************************************************/
  334.  
  335. pascal    OSErr    SetForeignPrivs(short vRefNum,
  336.                                 long dirID,
  337.                                 StringPtr name,
  338.                                 Ptr foreignPrivBuffer,
  339.                                 long *foreignPrivSize,
  340.                                 long foreignPrivInfo1,
  341.                                 long foreignPrivInfo2,
  342.                                 long foreignPrivInfo3,
  343.                                 long foreignPrivInfo4);
  344. /*    ¶ Change the native access-control information.
  345.     The SetForeignPrivs function changes the native access-control
  346.     information for a file or directory stored on a volume managed by
  347.     a foreign file system.
  348.     
  349.     vRefNum                input:    Volume specification.
  350.     dirID                input:    Directory ID.
  351.     name                input:    Pointer to object name, or nil when dirID
  352.                                 specifies a directory that's the object.
  353.     foreignPrivBuffer    input:    Pointer to privilege information buffer.
  354.     foreignPrivSize        input:    Size of buffer pointed to by
  355.                                 foreignPrivBuffer.
  356.                         output: Amount of buffer actually used.
  357.     foreignPrivInfo1    input:    Information specific to privilege model.
  358.     foreignPrivInfo2    input:    Information specific to privilege model.
  359.     foreignPrivInfo3    input:    Information specific to privilege model.
  360.     foreignPrivInfo4    input:    Information specific to privilege model.
  361.  
  362.     __________
  363.     
  364.     Also see:    GetForeignPrivs, FSpGetForeignPrivs, FSpSetForeignPrivs
  365. */
  366.  
  367. /*****************************************************************************/
  368.  
  369. pascal    OSErr    FSpSetForeignPrivs(const FSSpec *spec,
  370.                                    Ptr foreignPrivBuffer,
  371.                                    long *foreignPrivSize,
  372.                                    long foreignPrivInfo1,
  373.                                    long foreignPrivInfo2,
  374.                                    long foreignPrivInfo3,
  375.                                    long foreignPrivInfo4);
  376. /*    ¶ Change the native access-control information.
  377.     The FSpSetForeignPrivs function changes the native access-control
  378.     information for a file or directory stored on a volume managed by
  379.     a foreign file system.
  380.     
  381.     spec                input:    An FSSpec record specifying the object.
  382.     foreignPrivBuffer    input:    Pointer to privilege information buffer.
  383.     foreignPrivSize        input:    Size of buffer pointed to by
  384.                                 foreignPrivBuffer.
  385.                         output: Amount of buffer actually used.
  386.     foreignPrivInfo1    input:    Information specific to privilege model.
  387.     foreignPrivInfo2    input:    Information specific to privilege model.
  388.     foreignPrivInfo3    input:    Information specific to privilege model.
  389.     foreignPrivInfo4    input:    Information specific to privilege model.
  390.  
  391.     __________
  392.     
  393.     Also see:    GetForeignPrivs, FSpGetForeignPrivs, SetForeignPrivs
  394. */
  395.  
  396. /*****************************************************************************/
  397.  
  398. pascal    OSErr    HGetLogInInfo(StringPtr volName,
  399.                               short vRefNum,
  400.                               short *loginMethod,
  401.                               StringPtr userName);
  402. /*    ¶ Get the login method and user name used to log on to a shared volume.
  403.     The HGetLogInInfo function retrieves the login method and user name
  404.     used to log on to a particular shared volume.
  405.     
  406.     volName        input:    A pointer to the name of a mounted volume
  407.                         or nil.
  408.     vRefNum        input:    The volume reference number.
  409.     loginMethod    output:    The login method used (kNoUserAuthentication,
  410.                         kPassword, kEncryptPassword, or
  411.                         kTwoWayEncryptPassword).
  412.     userName    input:    Points to a buffer (minimum Str31) where the user
  413.                         name is to be returned or must be nil.
  414.                 output:    The user name.
  415.  
  416.     __________
  417.     
  418.     Also see:    HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
  419.                 FSpSetDirAccess, HMapName, HMapID
  420. */
  421.  
  422. /*****************************************************************************/
  423.  
  424. pascal    OSErr    HGetDirAccess(short vRefNum,
  425.                               long dirID,
  426.                               StringPtr name,
  427.                               long *ownerID,
  428.                               long *groupID,
  429.                               long *accessRights);
  430. /*    ¶ Get a directory's access control information on a shared volume.
  431.     The HGetDirAccess function retrieves the directory access control
  432.     information for a directory on a shared volume.
  433.     
  434.     vRefNum            input:    Volume specification.
  435.     dirID            input:    Directory ID.
  436.     name            input:    Pointer to directory name, or nil if dirID
  437.                             specifies the directory.
  438.     ownerID            output:    The directory's owner ID.
  439.     groupID            output:    The directory's group ID or
  440.                             0 if no group affiliation.
  441.     accessRights    output:    The directory's access rights.
  442.  
  443.     __________
  444.     
  445.     Also see:    HGetLogInInfo, FSpGetDirAccess, HSetDirAccess,
  446.                 FSpSetDirAccess, HMapName, HMapID
  447. */
  448.  
  449. /*****************************************************************************/
  450.  
  451. pascal    OSErr    FSpGetDirAccess(const FSSpec *spec,
  452.                                 long *ownerID,
  453.                                 long *groupID,
  454.                                 long *accessRights);
  455. /*    ¶ Get a directory's access control information on a shared volume.
  456.     The FSpGetDirAccess function retrieves the directory access control
  457.     information for a directory on a shared volume.
  458.     
  459.     spec            input:    An FSSpec record specifying the directory.
  460.     ownerID            output:    The directory's owner ID.
  461.     groupID            output:    The directory's group ID or
  462.                             0 if no group affiliation.
  463.     accessRights    output:    The directory's access rights.
  464.  
  465.     __________
  466.     
  467.     Also see:    HGetLogInInfo, HGetDirAccess, HSetDirAccess,
  468.                 FSpSetDirAccess, HMapName, HMapID
  469. */
  470.  
  471. /*****************************************************************************/
  472.  
  473. pascal    OSErr    HSetDirAccess(short vRefNum,
  474.                               long dirID,
  475.                               StringPtr name,
  476.                               long ownerID,
  477.                               long groupID,
  478.                               long accessRights);
  479. /*    ¶ Set a directory's access control information on a shared volume.
  480.     The HSetDirAccess function changes the directory access control
  481.     information for a directory on a shared volume. You must own a directory
  482.     to change its access control information.
  483.     
  484.     vRefNum            input:    Volume specification.
  485.     dirID            input:    Directory ID.
  486.     name            input:    Pointer to directory name, or nil if dirID
  487.                             specifies the directory.
  488.     ownerID            output:    The directory's owner ID.
  489.     groupID            output:    The directory's group ID or
  490.                             0 if no group affiliation.
  491.     accessRights    output:    The directory's access rights.
  492.  
  493.     __________
  494.     
  495.     Also see:    HGetLogInInfo, HGetDirAccess, FSpGetDirAccess,
  496.                 FSpSetDirAccess, HMapName, HMapID
  497. */
  498.  
  499. /*****************************************************************************/
  500.  
  501. pascal    OSErr    FSpSetDirAccess(const FSSpec *spec,
  502.                                 long ownerID,
  503.                                 long groupID,
  504.                                 long accessRights);
  505. /*    ¶ Set a directory's access control information on a shared volume.
  506.     The FSpSetDirAccess function changes the directory access control
  507.     information for a directory on a shared volume. You must own a directory
  508.     to change its access control information.
  509.     
  510.     spec            input:    An FSSpec record specifying the directory.
  511.     ownerID            output:    The directory's owner ID.
  512.     groupID            output:    The directory's group ID or
  513.                             0 if no group affiliation.
  514.     accessRights    output:    The directory's access rights.
  515.  
  516.     __________
  517.     
  518.     Also see:    HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
  519.                 HMapName, HMapID
  520. */
  521.  
  522. /*****************************************************************************/
  523.  
  524. pascal    OSErr    HMapID(StringPtr volName,
  525.                        short vRefNum,
  526.                        long ID,
  527.                        short objType,
  528.                        StringPtr name);
  529. /*    ¶ Map a user or group ID to a user or group name.
  530.     The HMapID function determines the name of a user or group if you know
  531.     the user or group ID.
  532.     
  533.     volName        input:    A pointer to the name of a mounted volume
  534.                         or nil.
  535.     vRefNum        input:    Volume specification.
  536.     objType        input:    The mapping function code: 1 if you're mapping a
  537.                         user ID to a user name or 2 if you're mapping a
  538.                         group ID to a group name.
  539.     name        input:    Points to a buffer (minimum Str31) where the user
  540.                         or group name is to be returned or must be nil.
  541.                 output:    The user or group name.
  542.  
  543.     __________
  544.     
  545.     Also see:    HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
  546.                 FSpSetDirAccess, HMapName
  547. */
  548.  
  549. /*****************************************************************************/
  550.  
  551. pascal    OSErr    HMapName(StringPtr volName,
  552.                          short vRefNum,
  553.                          ConstStr255Param name,
  554.                          short objType,
  555.                          long *ID);
  556. /*    ¶ Map a user or group name to a user or group ID.
  557.     The HMapName function determines the user or group ID if you know the
  558.     user or group name.
  559.     
  560.     volName        input:    A pointer to the name of a mounted volume
  561.                         or nil.
  562.     vRefNum        input:    Volume specification.
  563.     name        input:    The user or group name.
  564.     objType        input:    The mapping function code: 3 if you're mapping a
  565.                         user name to a user ID or 4 if you're mapping a
  566.                         group name to a group ID.
  567.     ID            output:    The user or group ID.
  568.  
  569.     __________
  570.     
  571.     Also see:    HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
  572.                 FSpSetDirAccess, HMapID
  573. */
  574.  
  575. /*****************************************************************************/
  576.  
  577. pascal    OSErr    HCopyFile(short srcVRefNum,
  578.                           long srcDirID,
  579.                           ConstStr255Param srcName,
  580.                           short dstVRefNum,
  581.                           long dstDirID,
  582.                           StringPtr dstPathname,
  583.                           StringPtr copyName);
  584. /*    ¶ Duplicate a file on a file server and optionally to rename it.
  585.     The HCopyFile function duplicates a file and optionally to renames it.
  586.     The source and destination volumes must be on the same file server.
  587.     This function instructs the server to copy the file.
  588.     
  589.     srcVRefNum    input:    Source volume specification.
  590.     srcDirID    input:    Source directory ID.
  591.     srcName        input:    Source file name.
  592.     dstVRefNum    input:    Destination volume specification.
  593.     dstDirID    input:    Destination directory ID.
  594.     dstPathname    input:    Pointer to destination directory name, or
  595.                         nil when dstDirID specifies a directory.
  596.     copyName    input:    Points to the new file name if the file is to be
  597.                         renamed or nil if the file isn't to be renamed.
  598.  
  599.     __________
  600.     
  601.     Also see:    FSpCopyFile, FileCopy, FSpFileCopy
  602. */
  603.  
  604. /*****************************************************************************/
  605.  
  606. pascal    OSErr    FSpCopyFile(const FSSpec *srcSpec,
  607.                             const FSSpec *dstSpec,
  608.                             StringPtr copyName);
  609. /*    ¶ Duplicate a file on a file server and optionally to rename it.
  610.     The FSpCopyFile function duplicates a file and optionally to renames it.
  611.     The source and destination volumes must be on the same file server.
  612.     This function instructs the server to copy the file.
  613.     
  614.     srcSpec        input:    An FSSpec record specifying the source file.
  615.     dstSpec        input:    An FSSpec record specifying the destination
  616.                         directory.
  617.     copyName    input:    Points to the new file name if the file is to be
  618.                         renamed or nil if the file isn't to be renamed.
  619.  
  620.     __________
  621.     
  622.     Also see:    HCopyFile, FileCopy, FSpFileCopy
  623. */
  624.  
  625. /*****************************************************************************/
  626.  
  627. pascal    OSErr    HMoveRename(short vRefNum,
  628.                             long srcDirID,
  629.                             ConstStr255Param srcName,
  630.                             long dstDirID,
  631.                             StringPtr dstpathName,
  632.                             StringPtr copyName);
  633. /*    ¶ Move a file or directory on a file server and optionally to rename it.
  634.     The HMoveRename function moves a file or directory and optionally
  635.     renames it. The source and destination locations must be on the same
  636.     shared volume.
  637.     
  638.     vRefNum        input:    Volume specification.
  639.     srcDirID    input:    Source directory ID.
  640.     srcName        input:    The source object name.
  641.     dstDirID    input:    Destination directory ID.
  642.     dstName        input:    Pointer to destination directory name, or
  643.                         nil when dstDirID specifies a directory.
  644.     copyName    input:    Points to the new name if the object is to be
  645.                         renamed or nil if the object isn't to be renamed.
  646.  
  647.     __________
  648.     
  649.     Also see:    FSpMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
  650. */
  651.  
  652. /*****************************************************************************/
  653.  
  654. pascal    OSErr    FSpMoveRename(const FSSpec *srcSpec,
  655.                               const FSSpec *dstSpec,
  656.                               StringPtr copyName);
  657. /*    ¶ Move a file or directory on a file server and optionally to rename it.
  658.     The FSpMoveRename function moves a file or directory and optionally
  659.     renames it. The source and destination locations must be on the same
  660.     shared volume.
  661.     
  662.     srcSpec        input:    An FSSpec record specifying the source object.
  663.     dstSpec        input:    An FSSpec record specifying the destination
  664.                         directory.
  665.     copyName    input:    Points to the new name if the object is to be
  666.                         renamed or nil if the object isn't to be renamed.
  667.  
  668.     __________
  669.     
  670.     Also see:    HMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
  671. */
  672.  
  673. /*****************************************************************************/
  674.  
  675. pascal    OSErr    GetVolMountInfoSize(StringPtr volName,
  676.                                     short vRefNum,
  677.                                     short *size);
  678. /*    ¶ Get the size of a volume mounting information record.
  679.     The GetVolMountInfoSize function determines the how much space the
  680.     program needs to allocate for a volume mounting information record.
  681.     
  682.     volName        input:    A pointer to the name of a mounted volume
  683.                         or nil.
  684.     vRefNum        input:    Volume specification.
  685.     size        output:    The space needed (in bytes) of the volume mounting
  686.                         information record.
  687.  
  688.     __________
  689.     
  690.     Also see:    GetVolMountInfo, VolumeMount BuildAFPVolMountInfo,
  691.                 RetrieveAFPVolMountInfo
  692. */
  693.  
  694. /*****************************************************************************/
  695.  
  696. pascal    OSErr    GetVolMountInfo(StringPtr volName,
  697.                                 short vRefNum,
  698.                                 Ptr volMountInfo);
  699. /*    ¶ Retrieve a volume mounting information record.
  700.     The GetVolMountInfo function retrieves a volume mounting information
  701.     record containing all the information needed to mount the volume,
  702.     except for passwords.
  703.     
  704.     volName            input:    A pointer to the name of a mounted volume
  705.                             or nil.
  706.     vRefNum            input:    Volume specification.
  707.     volMountInfo    output:    Points to a volume mounting information
  708.                             record where the mounting information is to
  709.                             be returned.
  710.  
  711.     __________
  712.     
  713.     Also see:    GetVolMountInfoSize, VolumeMount, BuildAFPVolMountInfo,
  714.                 RetrieveAFPVolMountInfo
  715. */
  716.  
  717. /*****************************************************************************/
  718.  
  719. pascal    OSErr    VolumeMount(Ptr volMountInfo,
  720.                             short *vRefNum);
  721. /*    ¶ Mount a volume using a volume mounting information record.
  722.     The VolumeMount function mounts a volume using a volume mounting
  723.     information record.
  724.     
  725.     volMountInfo    input:    Points to a volume mounting information record.
  726.     vRefNum            output:    A volume reference number.
  727.  
  728.     __________
  729.     
  730.     Also see:    GetVolMountInfoSize, GetVolMountInfo, BuildAFPVolMountInfo,
  731.                 RetrieveAFPVolMountInfo
  732. */
  733.  
  734. /*****************************************************************************/
  735.  
  736. pascal    OSErr    Share(short vRefNum,
  737.                       long dirID,
  738.                       StringPtr name);
  739. /*    ¶ Establish a local volume or directory as a share point.
  740.     The Share function establishes a local volume or directory as a
  741.     share point.
  742.  
  743.     vRefNum            input:    Volume specification.
  744.     dirID            input:    Directory ID.
  745.     name            input:    Pointer to directory name, or nil if dirID
  746.                             specifies the directory.
  747.  
  748.     __________
  749.     
  750.     Also see:    FSpShare, Unshare, FSpUnshare
  751. */
  752.  
  753. /*****************************************************************************/
  754.  
  755. pascal    OSErr    FSpShare(const FSSpec *spec);
  756. /*    ¶ Establish a local volume or directory as a share point.
  757.     The FSpShare function establishes a local volume or directory as a
  758.     share point.
  759.  
  760.     spec    input:    An FSSpec record specifying the share point.
  761.  
  762.     Also see:    Share, Unshare, FSpUnshare
  763. */
  764.  
  765. /*****************************************************************************/
  766.  
  767. pascal    OSErr    Unshare(short vRefNum,
  768.                         long dirID,
  769.                         StringPtr name);
  770. /*    ¶ Remove a share point.
  771.     The Unshare function removes a share point.
  772.  
  773.     vRefNum            input:    Volume specification.
  774.     dirID            input:    Directory ID.
  775.     name            input:    Pointer to directory name, or nil if dirID
  776.                             specifies the directory.
  777.  
  778.     __________
  779.     
  780.     Also see:    Share, FSpShare, FSpUnshare
  781. */
  782.  
  783. /*****************************************************************************/
  784.  
  785. pascal    OSErr    FSpUnshare(const FSSpec *spec);
  786. /*    ¶ Remove a share point.
  787.     The FSpUnshare function removes a share point.
  788.  
  789.     spec    input:    An FSSpec record specifying the share point.
  790.  
  791.     __________
  792.     
  793.     Also see:    Share, FSpShare, Unshare
  794. */
  795.  
  796. /*****************************************************************************/
  797.  
  798. pascal    OSErr    GetUGEntry(short objType,
  799.                            StringPtr objName,
  800.                            long *objID);
  801. /*    ¶ Retrieve a user or group entry from the local file server.
  802.     The GetUGEntry function retrieves user or group entries from the
  803.     local file server.
  804.  
  805.     objType        input:    The object type: -1 = group; 0 = user
  806.     objName        input:    Points to a buffer (minimum Str31) where the user
  807.                         or group name is to be returned or must be nil.
  808.                 output:    The user or group name.
  809.     objID        input:    O to get the first user or group. If the entry objID
  810.                         last returned by GetUGEntry is passed, then user or
  811.                         group whose alphabetically next in the list of entries
  812.                         is returned.
  813.                 output:    The user or group ID.
  814.  
  815.     __________
  816.     
  817.     Also see:    GetUGEntries
  818. */
  819.  
  820. /*****************************************************************************/
  821.  
  822. #endif
  823.